package com.dkd.manage.service.impl;

import java.util.List;
import com.dkd.common.utils.DateUtils;
import com.dkd.manage.domain.vo.EquipmentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dkd.manage.mapper.EquipmentMapper;
import com.dkd.manage.domain.Equipment;
import com.dkd.manage.service.IEquipmentService;

/**
 * 设备管理Service业务层处理
 * 
 * @author lengxx
 * @date 2025-03-24
 */
@Service
public class EquipmentServiceImpl implements IEquipmentService
{
    @Autowired
    private EquipmentMapper equipmentMapper;

    /**
     * 查询设备管理
     * 
     * @param id 设备管理主键
     * @return 设备管理
     */
    @Override
    public Equipment selectequipmentById(Long id)
    {
        return equipmentMapper.selectequipmentById(id);
    }

    /**
     * 查询设备管理列表
     * 
     * @param equipment 设备管理
     * @return 设备管理
     */
    @Override
    public List<Equipment> selectequipmentList(Equipment equipment)
    {
        return equipmentMapper.selectequipmentList(equipment);
    }

    /**
     * 新增设备管理
     * 
     * @param equipment 设备管理
     * @return 结果
     */
    @Override
    public int insertequipment(Equipment equipment)
    {
        equipment.setCreateTime(DateUtils.getNowDate());
        return equipmentMapper.insertequipment(equipment);
    }

    /**
     * 修改设备管理
     * 
     * @param equipment 设备管理
     * @return 结果
     */
    @Override
    public int updateequipment(Equipment equipment)
    {
        equipment.setUpdateTime(DateUtils.getNowDate());
        return equipmentMapper.updateequipment(equipment);
    }

    /**
     * 批量删除设备管理
     * 
     * @param ids 需要删除的设备管理主键
     * @return 结果
     */
    @Override
    public int deleteequipmentByIds(Long[] ids)
    {
        return equipmentMapper.deleteequipmentByIds(ids);
    }

    /**
     * 删除设备管理信息
     * 
     * @param id 设备管理主键
     * @return 结果
     */
    @Override
    public int deleteequipmentById(Long id)
    {
        return equipmentMapper.deleteequipmentById(id);
    }

    @Override
    public List<EquipmentVo> selectquipmentVoList(Equipment equipment) {
        return equipmentMapper.selectequipmentVoList(equipment);
    }
}
